﻿using System.Drawing;
using System.Drawing.Printing;
using System.Windows.Forms;

namespace Common
{
    public class DocumentBase : PrintDocument
    {
        public Font Font = new Font("Verdana", 10, GraphicsUnit.Point);

        /// <summary>
        /// 预览打印
        /// </summary>
        /// <returns></returns>
        public DialogResult showPrintPreviewDialog()
        {
            PrintPreviewDialog dialog = new PrintPreviewDialog();
            dialog.Document = this;

            return dialog.ShowDialog();
        }

        /// <summary>
        /// 先设置后打印
        /// </summary>
        /// <returns></returns>
        public DialogResult ShowPageSettingsDialog()
        {
            PageSetupDialog dialog = new PageSetupDialog();
            dialog.Document = this;

            return dialog.ShowDialog();
        }
    }
}

